From: Carlos Garnacho Date: Mon, 30 May 2022 21:12:51 +0000 (+0200) Subject: keyboard: Always use ratio of visible level X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~461^2^2~13 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=f1fcce66aafdc3dad5376c87b8cb9ce50b7570cc;p=gnome-shell.git keyboard: Always use ratio of visible level Since the OSK keymap actors are cached, we no longer update the aspect container ratio as often as we should. Ensure to update the aspect ratio with language/level changes. Part-of: --- diff --git a/js/ui/keyboard.js b/js/ui/keyboard.js index 159ca7376..9811acd45 100644 --- a/js/ui/keyboard.js +++ b/js/ui/keyboard.js @@ -129,7 +129,7 @@ class KeyContainer extends St.Widget { this._maxCols = Math.max(this._currentCol, this._maxCols); } - layoutButtons(container) { + layoutButtons() { let nCol = 0, nRow = 0; for (let i = 0; i < this._rows.length; i++) { @@ -156,9 +156,10 @@ class KeyContainer extends St.Widget { nRow += KEY_SIZE; nCol = 0; } + } - if (container) - container.setRatio(this._maxCols, this._rows.length); + getRatio() { + return [this._maxCols, this._rows.length]; } }); @@ -1479,7 +1480,7 @@ var Keyboard = GObject.registerClass({ this._loadRows(currentLevel, level, levels.length, layout); layers[level] = layout; this._aspectContainer.add_child(layout); - layout.layoutButtons(this._aspectContainer); + layout.layoutButtons(); layout.hide(); } @@ -1877,6 +1878,7 @@ var Keyboard = GObject.registerClass({ this._currentPage = null; }); this._updateCurrentPageVisible(); + this._aspectContainer.setRatio(...this._currentPage.getRatio()); } _clearKeyboardRestTimer() {